VERSION 5.00
Begin VB.Form frmContratosBuscar 
   BorderStyle     =   5  'Sizable ToolWindow
   Caption         =   "CONTROL DE PAGOS DE COMISION YA PAGADA"
   ClientHeight    =   2055
   ClientLeft      =   45
   ClientTop       =   315
   ClientWidth     =   5415
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   Moveable        =   0   'False
   ScaleHeight     =   2055
   ScaleWidth      =   5415
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  'CenterScreen
   Begin VB.CommandButton Command2 
      Caption         =   "Salir"
      Height          =   252
      Left            =   3360
      TabIndex        =   4
      Top             =   1320
      Width           =   852
   End
   Begin VB.CommandButton cmdAceptar 
      Caption         =   "Aceptar"
      Height          =   252
      Left            =   2400
      TabIndex        =   3
      Top             =   1320
      Width           =   852
   End
   Begin VB.TextBox txtCodigoContrato 
      Appearance      =   0  'Flat
      Height          =   288
      Left            =   840
      TabIndex        =   0
      Top             =   1320
      Width           =   1092
   End
   Begin VB.Line Line2 
      BorderColor     =   &H00FFFFFF&
      X1              =   120
      X2              =   5160
      Y1              =   1800
      Y2              =   1800
   End
   Begin VB.Line Line1 
      BorderColor     =   &H00FFFFFF&
      X1              =   120
      X2              =   5160
      Y1              =   840
      Y2              =   840
   End
   Begin VB.Label Label1 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "DETALLE DE PAGOS DE COMISION ( H I S T O R I A )"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   615
      Left            =   840
      TabIndex        =   2
      Top             =   120
      Width           =   3855
   End
   Begin VB.Label Label3 
      BackColor       =   &H00800000&
      BackStyle       =   0  'Transparent
      Caption         =   "Contrato"
      ForeColor       =   &H00FFFFFF&
      Height          =   255
      Left            =   840
      TabIndex        =   1
      Top             =   1080
      Width           =   975
   End
End
Attribute VB_Name = "frmContratosBuscar"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
        
End Sub

Private Sub cmdAceptar_Click()
        If txtCodigoContrato.Text = "" Then
            MsgBox "Alguno de los campos esta vacio, revise por favor... "
            Exit Sub
        End If
        
              
        RutaReportes = DE.rsGENCParametros.Fields("RUTA_REPORTES")
        MDI.reporte.StoredProcParam(0) = UCase(txtCodigoContrato.Text)
        Imprimir RutaReportes & "RevisionComisionesPagadas.rpt", "", "", "", ""
            
        
End Sub

Private Sub Command2_Click()
        Unload Me
End Sub

Private Sub Form_Load()
    Left = Screen.Width / 2 - Width / 2
    Top = (Screen.Height / 2 - Height / 2) - 800
    Me.Picture = LoadResPicture(104, 0)
End Sub

Private Sub txtCodigoAsesor_KeyDown(KeyCode As Integer, Shift As Integer)
HacerTab KeyCode
End Sub

Private Sub txtCodigoAsesor_LostFocus()
                  
   CodigoPublico = ""
   CodigoPublico = UCase(txtCodigoAsesor.Text)
   MostrarRegistroEmpleados


End Sub
Private Sub MostrarRegistroEmpleados()
    On Error Resume Next
        
    
    If DE.rsBusqueEmpleado2.State = adStateOpen Then DE.rsBusqueEmpleado2.Close
    DE.BusqueEmpleado2 CodigoPublico
    
    If DE.rsBusqueEmpleado2.EOF Then
        MsgBox "Codigo de Asesor no existe"
        Exit Sub
    End If
    
    
     With DE.rsBusqueEmpleado2
       txtCodigoAsesor.Text = .Fields("Codigo_Empleado")
       lblAsesorVentas.Caption = .Fields("nombres")
              
    End With
Exit Sub
Errores:
    Errores Err, error
End Sub


Private Sub txtCodigoContrato_KeyDown(KeyCode As Integer, Shift As Integer)
    HacerTab KeyCode
End Sub

Private Sub txtCodigoContrato_LostFocus()

    'buscar datos del contrato
    On Error Resume Next
    If txtCodigoContrato.Text = "" Then Exit Sub
    
    If DE.rsDatosContrato.State = adStateOpen Then DE.rsDatosContrato.Close
    DE.DatosContrato UCase(txtCodigoContrato)
       
    If DE.rsDatosContrato.EOF Then
        MsgBox "Contrato no existe...."
        GrdDetalle.ClearFields
        LimpiarObjetos Me
        txtCodigoContrato.SetFocus
        Exit Sub
    End If
    
    txtCodigoContrato.Text = UCase(txtCodigoContrato)
    
End Sub
